import request from '@/utils/request'
// 获取树形结构根数据
export const getAssetTreeRootApi = () =>
  request.get('/core/vom/device-tree/root-node/list', {
    params: {
      treeModel: 'ENERGY_SET_TREE'
    }
  })

// 获取树形结构数据
export const getAssetDataApi = (data) =>
  request.post('/core/vom/device-tree/child-node/list', data)

// 获取模型节点菜单列表数据（按钮）
export const getContextmenusApi = (params) =>
  request.get('/core/vom/page-view/context-menu', { params })

// 获取动态界面模型
export const getFacerootApi = (params) =>
  request.get('/core/vom/page-view', { params })

// 获取模型设备实体初始化数据加下拉
export const getViewDataApi = (params) =>
  request.get('/core/vom/page-view/elements/view', { params })

// 获取模型新增初始化数据+下拉选项
export const getAddDataApi = (params) =>
  request.get('/core/vom/page-view/elements/init', { params })

// 获取模型修改初始化数据+下拉选项
export const getEditDataApi = (params) =>
  request.get('/core/vom/page-view/elements/modify', { params })

// 新增设备
export const addEquipmentApi = (data) =>
  request.post('/core/vom/page-view/data/create', data, {
    headers: {
      'Content-Type': 'multipart/form-data' // 设置请求头的 Content-Type 为 multipart/form-data
    }
  })

// 修改设备
export const editEquipmentApi = (data) =>
  request.post('/core/vom/page-view/data/modify', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })

// 检验实体数据是否可删除
export const checkoutDataApi = (data) =>
  request.post('/core/vom/page-view/data/delete-check', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })

// 删除实体数据
export const delDataApi = (data) =>
  request.post('/core/vom/page-view/data/delete', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
  // 搜索设备关键字过滤信息
export const getKeywordListApi = (params) =>
  request.get('/core/vom/device-tree/simple-device/list', { params })